﻿using System;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;
using Kingdee.BOS.Core.CloudModel.Cloud;

namespace MethodSetBus
{
    public class SAL_StockQueryBus
    {
        public string Get_StockQuery(string OrgNo,string MaterialNo)
        {
            StockQuery query = new StockQuery();
			query.FieldKeys = "FMasterId,FStockId,FInvQty,FInvLockQty,FAWAITINQTY,FAWAITOUTQTY,FINVBASEQTY";
			query.SchemeId = "";
			query.StartRow = 0;
			query.Limit = 2000;
			query.IsVerifyBaseDataField = "true";
			query.Model = new StockQuery_Model();
			StockQuery_Model _Model = new StockQuery_Model();
			_Model.FCheckAuxPropId = "false";
		    _Model.FCheckBomId = "false";
			_Model.FCheckMtoNo = "false";
			_Model.FCheckStockId = "true";
		    _Model.FCheckStockLocId = "false";
			_Model.FCheckLot = "false";
			_Model.FCheckProduceDate = "false";
			_Model.FCheckExpiryDate = "false";
			_Model.FCheckStockStatusId = "false";
			_Model.FCheckOwnerTypeId = "true";
			_Model.FCheckKeeperTypeId = "false";
			_Model.FCheckOwnerId = "true";
			_Model.FCheckKeeperId = "false";
			_Model.FStockOrgIds = new List<Kingdee.BOS.Core.CloudModel.OrgBase>();
			Kingdee.BOS.Core.CloudModel.OrgBase orgBase = new Kingdee.BOS.Core.CloudModel.OrgBase
			{
				FNumber = OrgNo
			};
			_Model.FStockOrgIds.Add(orgBase);
			_Model.FCheckStockOrgId = "true";
			_Model.FMaterialId = new Kingdee.BOS.Core.CloudModel.OrgBase
			{
				FNumber = MaterialNo
			};
			_Model.FIsShowZeroStockQty = "false";
			_Model.FIsShowAllMaterial = "false";
			_Model.FAvbQty = "A";
			_Model.FReqDatetime = "9999-12-31 00:00:00";
			query.Model = _Model;
			return JsonConvert.SerializeObject(query);
		}
    }
}
